package com.sun.test.execption;

import com.sun.test.common.ErrorCode;
import lombok.Getter;

@Getter
public class BusinessException extends RuntimeException{

    private final String code;
    private final String desc;

    public BusinessException(String code,String desc){
        this.code = code;
        this.desc = desc;
    }

    public BusinessException(ErrorCode errorCode){
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
        this.desc = errorCode.getDescription();
    }

    public BusinessException(ErrorCode errorCode,String desc){
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
